<?php 
$discount = 0;
$stardate = "";
$enddate = "";
    if(!empty($promotion)){
        $discount = $promotion->discount; 
        $stardate = date('d/m/Y',$promotion->startdate);
        $enddate = date('d/m/Y',$promotion->enddate);
    }
?>
<div class="" id="myModal" >
  <div class="modal-header">
    <h3 style="text-transform: capitalize;"><?php echo $action ?> Promotion</h3>
  </div>
<?php echo form_open('administrator/shop/promotion/save') ?>

<label for="discount">Discount:</label><input type="text"  name="discount" id="discount" value="<?php echo $discount?>"/>
        <label for="startdate">Start date:</label>
        <input type="text" name="startdate" id="startdate" value="<?php echo $stardate?>" />
        <label for="enddate">End date:</label>
        <input type="text" name="enddate" id="enddate" value="<?php echo $enddate?>" />
        <?php if(empty($promotion)):?>
        <label for="enddate">Quatity:</label>
        <input type="text" name="qty" id="qty"/>
        <?php endif;?>
        <div class="modal-footer">
    <input type="submit" class="btn btn-primary"  value="Save"/>
    <a href="<?php echo base_url().'/administrator/shop/promotion/'?>" class="btn">Cancel</a>
    <input type="hidden" name="action"  value="<?php echo $action ?>" id="action" />
    <input type="hidden" name="promotion_id"  value="<?php echo $promotion_id ?>" id="action" />
  </div> 
  </div>
</form>